﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using DataAnnotationsExtensions;

namespace JRFinances.ViewModels.RealTransactions
{
    public class CreateRealTransactionViewModel
    {
        public int CompanyId { get; set; }

        [Display(Name="Data")]
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")] // okreslenie formatu daty
        public DateTime Date { get; set; }

        [Display(Name = "Liczba")]
        [Min(1, ErrorMessage="Liczba zakupionych akcji musi byc wieksza od 1")] // minimalny wolumen wynosi 1
        public int Volume { get; set; }

        [Display(Name = "Cena")]
        [Min(0.01, ErrorMessage="Cena zakupu musi byc wieksza od 0.01zl")] // minimalna cena akcji wynosi 0.01zl
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:F2}")]
        public double Price { get; set; }

        public bool Buy { get; set; }
    }
}